<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.23.
   家居公司视频模型($$)*/

!defined('Q_PATH') && exit;

class JiajuvideoModel extends CommonModel{

	static public function init__(){
		return array(
			'table_name'=>'jiajuvideo',
			'check'=>array(
				'jiajuvideo_sort'=>array(
					array('number',Q::L('序号只能是数字','__COMMON_LANG__@Common')),
				),
				'jiajuvideo_title'=>array(
					array('require',Q::L('视频标题不能为空','__APPJIAJU_COMMON_LANG__@Model')),
					array('max_length',100,Q::L('视频标题不能超过100个字符','__APPJIAJU_COMMON_LANG__@Model')),
				),
				'jiajuvideo_filename'=>array(
					array('require',Q::L('视频文件地址不能为空','__APPJIAJU_COMMON_LANG__@Model')),
					array('max_length',200,Q::L('视频文件地址不能超过200个字符','__APPJIAJU_COMMON_LANG__@Model')),
				),
				'jiajuvideo_description'=>array(
					array('max_length',250,Q::L('视频描述不能超过250个字符','__APPJIAJU_COMMON_LANG__@Model')),
				),
			),
		);
	}

	static function F(){
		$arrArgs=func_get_args();
		return ModelMeta::instance(__CLASS__)->findByArgs($arrArgs);
	}

	static function M(){
		return ModelMeta::instance(__CLASS__);
	}

	protected function beforeSave_(){
		$this->jiajuvideo_filename=C::strip($this->jiajuvideo_filename);
		$this->jiajuvideo_title=C::text($this->jiajuvideo_title);
		$this->jiajuvideo_description=C::text($this->jiajuvideo_description);
		$this->jiajuvideo_username=C::text($this->jiajuvideo_username);
		$this->jiajuvideo_editusername=C::text($this->jiajuvideo_editusername);

		if($this->jiajuvideo_sort<0){
			$this->jiajuvideo_sort=0;
		}
		if($this->jiajuvideo_sort>999){
			$this->jiajuvideo_sort=999;
		}
	}

}
